package cn.lili.controller.feign;

import cn.lili.modules.distribution.client.DistributionGoodsClient;
import cn.lili.modules.distribution.entity.dos.DistributionGoods;
import cn.lili.modules.distribution.entity.dto.DistributionGoodsSearchParams;
import cn.lili.modules.distribution.service.DistributionGoodsService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 分销商品 feign 实现类
 *
 * @author Chopper
 * @version v1.0
 * 2021-12-07 07:58
 */
@RestController
@RequiredArgsConstructor
public class DistributionGoodsFeignController implements DistributionGoodsClient {

    private final DistributionGoodsService distributionGoodsService;

    @Override
    public List<DistributionGoods> distributionGoods(List<String> skuIds) {
        return distributionGoodsService.distributionGoods(skuIds);
    }

    @Override
    public DistributionGoods getDistributionGoods(DistributionGoodsSearchParams searchParams) {
        return distributionGoodsService.getDistributionGoods(searchParams);
    }

    @Override
    public void removeById(String id) {
        distributionGoodsService.removeById(id);
    }

    @Override
    public void distributionCheckGoods(String skuId) {
        distributionGoodsService.checked(skuId, null);
    }

    @Override
    public void distributionCheckGoodsAndStoreId(String skuId, String storeId) {
        distributionGoodsService.checked(skuId, storeId);
    }
}
